package Lecture7_7;

public class GrossDevisionNumber {

	public static void main(String[] args) 
	{

		int x = 1071;
		int y = 1029;
		
		int result = maxDelitel(x, y);
		System.out.println(result);
		
	}

	public static int maxDelitel (int x, int y)
	{
		
		if (x > y)
		{
			return maxDelitel(x - y, y );          
		}
		else
			if(x < y)
			{
				return maxDelitel(x, y - x);
			}
			else
			{
				return y;
			}
		
		
		
	}
	
	
	
}
